/**
 * 
 */
package com.roc.util.constant;

import org.apache.commons.lang3.StringUtils;

/**
 * @author dxpeng 2013-8-8 下午6:32:41
 */
public enum MerchantStatus {
	//商户有效标志 1-正常 0-未开通  2 待复审  3 待终审 4 信息不完整 5 初审未通过 6复审未通过 7 终审未通过 8 交易冻结 9 结算冻结 
	 S_0("未开通", 0),
	 S_1("正常", 1),
	 S_2("待复审",2),
	 S_3("待终审",3),
	 S_4("驳回",4),
	 S_5("初审未通过",5),
	 S_6("复审未通过",6),
	 S_7("终审未通过 ",7),
	 S_8("交易冻结",8),
	 S_9("结算冻结",9),
	 S_10("待业务复审",10),
	 S_11("业务复审未通过",11),
	 S_12("待补全",12),
	 S_13("冻结",13),
	 S_14("注销",14),
	 S_15("作废",15);
	 
	 
	private int code;
	private String name;
	private boolean editAble;
	private boolean enabled;

	private MerchantStatus( String name,int code) {
		this.code = code;
		this.name = name;
		
	}

	public boolean isEditAble() {
		return editAble;
	}

	public boolean isEnabled() {
		return enabled;
	}

	public int getCode() {
		return code;
	}

	public String getName() {
		return name;
	}

	public static MerchantStatus valueOfCode(int code) {
		
		for (MerchantStatus ms : values()) {
			if (ms.getCode()==code) {
				return ms;
			}
		}
		throw new IllegalArgumentException("MerchantStatus code " + code
				+ " is not exist");
	}

}
